package homework_02.home_02;
import java.util.*;

public class HomeWork_02 {
    public static void main(String[] args) {
        System.out.println("请输入a的值：");
        int a;
        Scanner input = new Scanner(System.in);
        a= input.nextInt();
        int x=0,y=0;
        while(a>0){
            y=a%10;
            x+=y;
            a=a/10;
        }
        System.out.println(x);
    }
}
